package config

type FileServerConf struct {
	PrivateUrlPrefix string
	PublicUrlPrefix  string
	Domain           string
}

func (f *FileServerConf) GeneratePublicFileUrl(relativePath string) string {
	if f.Domain == "" || f.PublicUrlPrefix == "" || relativePath == "" {
		return ""
	}
	return f.Domain + f.PublicUrlPrefix + relativePath
}

func (f *FileServerConf) GeneratePrivateFileUrl(fileId string) string {
	if f.Domain == "" || f.PrivateUrlPrefix == "" || fileId == "" {
		return ""
	}
	return f.Domain + f.PublicUrlPrefix + fileId
}
